import time
from Base import Base
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

class Page(Base):
    search_loc1 = (By.ID,'input')
    search_loc2 = (By.NAME, 'q')
    def search(self):
        self.send_keys(self.search_loc1,'我在做软件测试')

    searchbtn_loc = (By.ID,'search-button')
    def searchbtn(self):
        self.webdriver(self.searchbtn_loc)

    dy1_loc = (By.XPATH,'/html/head/title')
    def dy1(self):
        self.text(self.dy1_loc)

    next_loc = (By.ID,'snext')
    def next(self):
        self.click(self.next_loc)

    def luoji_01_search(self):
        self.get_url('https://www.so.com/')
        time.sleep(1)
        self.search()
        self.searchbtn()
        time.sleep(1)
        print(self.driver.title)
        time.sleep(1)
        self.next()
        print(self.driver.title)